#include <WinTen.h>
#include <Windows.h>
#include <ClipApi.h>

void pascal _DrawBitmap( HDC hDC, HBITMAP hBitmap, WORD wCol, WORD wRow )
{
   BITMAP bm;
   HDC hdcMem;
   DWORD dwSize;
   POINT ptSize, ptOrg;

   hdcMem = CreateCompatibleDC( hDC );
   SelectObject( hdcMem, hBitmap );
   SetMapMode( hdcMem, GetMapMode( hDC ) );
   GetObject( hBitmap, sizeof( BITMAP ), ( LPSTR ) &bm );
   ptSize.x = bm.bmWidth;
   ptSize.y = bm.bmHeight;
   DPtoLP( hDC, &ptSize, 1 );
   ptOrg.x = 0;
   ptOrg.y = 0;
   DPtoLP( hdcMem, &ptOrg, 1 );
   BitBlt( hDC, wRow, wCol, ptSize.x, ptSize.y, hdcMem, ptOrg.x, ptOrg.y,
           SRCCOPY );
   DeleteDC( hdcMem );
}

CLIPPER DRAWBITMAP()
{
   _DrawBitmap( _parni( 1 ), _parni( 2 ), _parni( 3 ), _parni( 4 ) );
}
